	/**
	 * Main actionscript file for flashSQL class.
	 * 
	 * @author Janov Byrnisson
	 * @date 11-jul-2009
	 */
	 
	import classes.MySQLService;
	import classes.utils.CookieUtil;
	import classes.utils.MD5;
	
	import components.AuthenticationWindow;
	import components.MainContainer;
	import components.CreateDBPanel;
	
	import mx.managers.PopUpManager;
	
	
	public static const MD5_HASH:String = MD5.encrypt("flashSQL_Auth"); 
	
	private var authWin:AuthenticationWindow; 
	
	public static var LANG_PREF:String;
	public static var mainCont:MainContainer; 
	
	public function initApp():void
	{	
		if( CookieUtil.getCookie( flashSQL.MD5_HASH ) )
		{
			mainCont = new MainContainer();
			
			this.addChild( mainCont );			
		}	
		else
		{ 	
		 	authWin = PopUpManager.createPopUp( this, AuthenticationWindow, false ) as AuthenticationWindow;
		 	PopUpManager.centerPopUp( authWin );
		} 	
	}

		